Booting an application from multiple memories

ABSTRACT

A method includes using a memory address map, locating a first portion of an application in a first memory and loading a second portion of the application from a second memory. The method includes executing in place from the first memory the first portion of the application, during a first period, and by completion of the loading of the second portion of the application from the second memory. The method further includes executing the second portion of the application during a second period, wherein the first period precedes the second period.

RELATED APPLICATIONS

This Application is a Continuation of U.S. patent application Ser. No.16/010,142, filed on Jun. 15, 2018, which is a Continuation Applicationof U.S. patent application Ser. No. 14/319,079 filed on Jun. 30, 2014,now U.S. Pat. No. 10,019,351, issued on Jul. 10, 2018, both of which arehereby incorporated by reference in their entirety.

BACKGROUND Background

Generally, current approaches to booting an application use one of twogeneral techniques. The first technique executes an application in placefrom a non-volatile, low latency memory, e.g. NOR memory. This techniquehas several disadvantages. Particularly, non-volatile, low latencymemory is very expensive; even for simple applications, the amount ofmemory needed to store the entire application is costly. Attempts toreduce an application's footprint in memory, e.g. compression, addscomputational complexity that affects performance by increasingexecution time.

The second technique loads a memory from a non-volatile memory with alatency. This technique has its own disadvantages. Because of the higherlatency, it is either not possible or undesirable to execute anapplication in place. Thus, the application needs to be loaded intoanother memory, typically a volatile memory, e.g. RAM, from which it isexecuted. The loading time affects performance by also increasingexecution time.

SUMMARY

Provided herein are system, apparatus, article of manufacture, methodand/or computer program product embodiments, and/or combinations andsub-combinations thereof, for booting an application from multiplememories.

An embodiment includes a method for booting an application from multiplememories. The method operates by executing in place from a first memorya first portion of the application, loading a second portion of theapplication from a second memory, and executing the second portion ofthe application.

Another embodiment includes a system for booting an application frommultiple memories. The system includes a memory and at least oneprocessor coupled to the memory. The processor is configured to executein place from a first memory a first portion of an application, load asecond portion of the application from a second memory, and execute thesecond portion of the application.

A further embodiment includes a tangible computer-readable device havinginstructions stored thereon that, when executed by at least onecomputing device, cause the computing device to perform operations. Theoperations include executing in place from a first memory a firstportion of an application, loading a second portion of the applicationfrom a second memory, and executing the second portion of theapplication.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are incorporated herein and form a part of thespecification.

FIG. 1 is a block diagram of a system for booting an application frommultiple memories, according to an example embodiment.

FIG. 2 is a block diagram of a memory address map, according to anexample embodiment.

FIG. 3 is a flowchart illustrating a process for accessing a cache,according to an example embodiment.

FIG. 4 is a block diagram of an execution flow, according to an exampleembodiment.

FIG. 5 is an example computer system useful for implementing variousembodiments.

In the drawings, like reference numbers generally indicate identical orsimilar elements. Additionally, generally, the left-most digit(s) of areference number identifies the drawing in which the reference numberfirst appears.

DETAILED DESCRIPTION

FIG. 1 is a block diagram of an example system 100 that includes amicrocontroller (MCU) 102, a first memory 104, a second memory 106, anda third memory 108. Although system 100 is depicted as having one MCUand three memories, embodiments of the invention support any number ofMCUs and any number of memories.

In an embodiment, MCU 102 stores data to or loads data from first memory104, second memory 106, or third memory 108. For example, MCU 102 canboot an application from first memory 104 and second memory 106. MCU 102can comprise an integrated circuit, application-specific integratedcircuit (ASIC), field-programmable gate array (FPGA), processing core,digital signal processor (DSP), microcontroller (MCU), microprocessor(MPU), or any combination thereof.

An application can be divided into two or more portions. In anembodiment, the application is divided into at least a first portion 112and a second portion 114, so that first portion 112 is executed in placefrom first memory 104 by the time second portion 114 has loaded fromsecond memory 106. The application can be divided in numerous ways. Forexample, a programmer, software engineer or architect, or otherdeveloper can segment the code into the first portion 112 and secondportion 114 to achieve the property that the first portion 112 isexecuted in place from first memory 104 by the time second portion 114has loaded from second memory 106. Automated systems and/or processorsfor performing the following can also be used. As another example, theapplication can be developed using an application programming interface(API). The API can provide functionality so that a developer can specifywhich portions of the application belong in the first portion 112 andsecond portion 114. Alternatively or additionally, the API can providefunctionality so that a developer can specify an order of priority ofcode, from which a compiler, linker, other tool, or any combinationthereof can build the first portion 112 and second portion 114 toachieve the property that the first portion 112 is executed in placefrom first memory 104 by the time second portion 114 has loaded fromsecond memory 106. In another embodiment, a compiler, linker, othertool, or any combination thereof segment the application into the firstportion 112 and second portion 114 without input or instruction from auser to achieve the property that the first portion 112 is executed inplace from first memory 104 by the time second portion 114 has loadedfrom second memory 106.

In an embodiment, first portion 112 of the application comprisesapplication initialization code (AIC) and application execution code(AEC). AIC can include instructions that initialize the application. AECcan include instructions for executing the application once theapplication has been initialized.

In an embodiment, first memory 104 comprises a non-volatile, low latencymemory that supports execution in place (XIP). XIP can refer to a methodof executing a program directly from storage rather than copying it toone or more intermediate memories, e.g. random access memory (RAM). Forexample, first memory 104 can be any non-volatile memory, such as a NORmemory, a read only memory (ROM), an erasable programmable read onlymemory (EPROM), a mask ROM (MROM), a resistive random access memory(RRAM), a phase-change memory (PCM), or any combination thereof.

In an embodiment, first memory 104 comprises hardware initializationcode (HIC) 110, a first portion 112 of an application, other code, orany combination thereof. MCU 102 can be configured to execute in placeHIC 110, a first portion 112 of an application, other code, or anycombination thereof.

In an embodiment, second memory 106 comprises a non-volatile memoryhaving a higher latency than first memory 104. For example, secondmemory 106 can be a NAND memory, magnetic media (e.g. a hard drive),optical media (e.g. a CD-ROM or DVD), RRAM, a slow, multi-level NOR, orany combination thereof. In an embodiment, second memory 106 does notsupport XIP or cannot practically be used for XIP due to its latency.

In an embodiment, second memory 106 comprises a second portion 114 ofthe application. First portion 112 and second portion 114 may form thecomplete application or only a part of the application.

In an embodiment, third memory 108 comprises a volatile, low latencymemory. For example, third memory 108 can be a RAM, dynamic RAM (DRAM),synchronous dynamic RAM (SDRAM), static RAM (SRAM), pseudo-static RAM(pSRAM), or any combination thereof. In an embodiment, an applicationmay be copied into third memory 108 from first memory 104, second memory106, another memory, or any combination thereof.

In an embodiment, MCU 102 can be configured to load second portion 114of the application into third memory 108 and to execute second portion114 of the application from third memory 108.

FIG. 2 is a block diagram of a memory address map 200, according to anexample embodiment. Memory address map 200 reflects the address spacelayout code in memory. In an embodiment, MCU 102 uses memory address map200 to locate or address HIC 110, first portion 112 of the application,second portion 114 of the application, other code, or any combinationthereof.

Memory address map 200 comprises a first section 202 and a secondsection 204. First section 202 includes address mappings of HIC 110 andfirst portion 112 of the application. In an embodiment, first section202 corresponds to first memory 104 and maps addresses thereto. Forexample, first section 202 can correspond to a NOR memory storing HIC110 and first portion 112 of the application.

Second section 204 includes address mappings to second portion 114 ofthe application. In an embodiment, second section 204 corresponds tosecond memory 106, third memory 108, or any combination thereof, andmaps addresses thereto. For example, second section 204 can correspondto a NAND memory or RAM storing second portion 114 of the application.

Although memory address map 200 has two sections with the particularlayout depicted, embodiments of the invention support any number ofsections or layouts. For example, sections 202 and 204 can benon-contiguous, interwoven, or any combination thereof. As anotherexample, second memory 106 and third memory 108 can have their ownregions in memory address map 200.

FIG. 3 is a flowchart illustrating a process 300 for booting anapplication from multiple memories, according to an example embodiment.Process 300 can be performed by processing logic that can comprisehardware (e.g., circuitry, dedicated logic, programmable logic,microcode, etc.), software (e.g., instructions run on a processingdevice), or a combination thereof. For example, process 300 may beperformed by MCU 102.

FIG. 4 is a block diagram of execution flow 400 resulting from process300, according to an example embodiment, and will be discussed inconjunction with FIG. 3, although it should be understood that process300 is not limited to the example of FIG. 4. In execution flow 400, thehorizontal axis represents time during execution.

In block 302, first portion 112 of the application is executed in placefrom first memory 104. For example, first portion 112 can be executeddirectly from first memory 104 rather than copying it to one or moreintermediate memories, such as second memory 106 or third memory 108. Inan embodiment, MCU 102 executes in place first portion 112 of theapplication.

In an embodiment, HIC 110 is executed in place from first memory 104.MCU 102 can execute HIC 110 in place from first memory 104 beforeexecuting the first portion 112 of the application. FIG. 4 depictsexecution of HIC 110 at block 402 and the execution of first portion 112at block 404. In an embodiment, execution of the first portion 112 ofthe application includes execution of AIC at block 406 and execution ofAEC at block 408.

Referring back to FIG. 3, in block 304, second portion 114 of theapplication is loaded from second memory 106. In an embodiment, MCU 102loads second portion 114 of the application from second memory 106. FIG.4 depicts loading second portion 114 at block 410.

In an embodiment, second portion 114 of the application is loaded fromsecond memory 106 into third memory 108. For example, MCU 102 can loadsecond portion 114 of the application from a NAND memory into a RAMmemory.

In an embodiment, at least some of the executing in place of the firstportion 112 of the application from the first memory and at least someof the loading the second portion 114 occur in parallel. For example,FIG. 4 depicts execution of the first portion 112 at block 404 and theloading of the second portion 114 at block 410 occurring concurrently.

In an embodiment, second portion 114 is loaded by the time the firstportion 112 of the application has been executed in place. For example,FIG. 4 depicts the second portion 114 having been loaded by time 412,the time at which the first portion 112 of the application has beenexecuted in place.

In an embodiment, the second portion 114 is loaded into third memory 108by the time first portion 112 has been executed in place. For example,second portion 114 can be loaded from a NAND memory into RAM by the timefirst portion 112 has been executed in place in a NOR memory.

Referring back to FIG. 3, in block 306, second portion 114 of theapplication is executed. In an embodiment, MCU 102 executes secondportion 114 of the application. For example, FIG. 4 depicts the secondportion 114 being executed at block 414 after time 412, the time atwhich the first portion 112 of the application has been executed inplace.

In an embodiment, second portion 114 of the application is executed fromthird memory 108. For example, second portion 114 can be executed from avolatile memory, e.g. RAM.

In an embodiment, second portion 114 of the application is executedusing at least one of demand paging or shadow mode. For example, inshadow mode, second portion 114 may be loaded entirely from secondmemory 106 into third memory 108, and then second portion 114 isexecuted entirely from third memory 108. In another example using demandpaging, the currently required part of the code, which may berepresented as second portion 114, can be loaded and executed out ofthird memory 108. As one or more other portions of the application arerequired, they can be loaded and executed out of third memory 108 asneeded.

Example Computer System

Various embodiments can be implemented, for example, using one or morewell-known computer systems, such as computer system 500 shown in FIG.5. Computer system 500 can be any well-known computer capable ofperforming the functions described herein, such as computers availablefrom International Business Machines, Apple, Sun, HP, Dell, Sony,Toshiba, etc. Computer system 500 can also be any embedded systemcapable of performing the functions described herein, such as embeddedsystems available from Renesas, Freescale, TI, Spansion, etc.

Computer system 500 includes one or more processors (also called centralprocessing units, or CPUs), such as a processor 504. Processor 504 isconnected to a communication infrastructure or bus 506.

One or more processors 504 may each be a graphics processing unit (GPU).In an embodiment, a GPU is a processor that is a specialized electroniccircuit designed to rapidly process mathematically intensiveapplications on electronic devices. The GPU may have a highly parallelstructure that is efficient for parallel processing of large blocks ofdata, such as mathematically intensive data common to computer graphicsapplications, images and videos.

Computer system 500 also includes user input/output device(s) 503, suchas monitors, keyboards, pointing devices, etc., which communicate withcommunication infrastructure 506 through user input/output interface(s)502.

Computer system 500 also includes a main or primary memory 508, such asrandom access memory (RAM). Main memory 508 may include one or morelevels of cache. Main memory 508 has stored therein control logic (i.e.,computer software) and/or data.

Computer system 500 may also include one or more secondary storagedevices or memory 510. Secondary memory 510 may include, for example, ahard disk drive 512 and/or a removable storage device or drive 514.Removable storage drive 514 may be a floppy disk drive, a magnetic tapedrive, a compact disk drive, an optical storage device, tape backupdevice, and/or any other storage device/drive.

Removable storage drive 514 may interact with a removable storage unit518. Removable storage unit 518 includes a computer usable or readablestorage device having stored thereon computer software (control logic)and/or data. Removable storage unit 518 may be a floppy disk, magnetictape, compact disk, DVD, optical storage disk, and/any other computerdata storage device. Removable storage drive 514 reads from and/orwrites to removable storage unit 518 in a well-known manner.

According to an exemplary embodiment, secondary memory 510 may includeother means, instrumentalities or other approaches for allowing computerprograms and/or other instructions and/or data to be accessed bycomputer system 500. Such means, instrumentalities or other approachesmay include, for example, a removable storage unit 522 and an interface520. Examples of the removable storage unit 522 and the interface 520may include a program cartridge and cartridge interface (such as thatfound in video game devices), a removable memory chip (such as an EPROMor PROM) and associated socket, a memory stick and USB port, a memorycard and associated memory card slot, and/or any other removable storageunit and associated interface.

Computer system 500 may further include a communication or networkinterface 524. Communication interface 524 enables computer system 500to communicate and interact with any combination of remote devices,remote networks, remote entities, etc. (individually and collectivelyreferenced by reference number 528). For example, communicationinterface 524 may allow computer system 500 to communicate with remotedevices 528 over communications path 526, which may be wired and/orwireless, and which may include any combination of LANs, WANs, theInternet, etc. Control logic and/or data may be transmitted to and fromcomputer system 500 via communication path 526.

In an embodiment, a tangible apparatus or article of manufacturecomprising a tangible computer useable or readable medium having controllogic (software) stored thereon is also referred to herein as a computerprogram product or program storage device. This includes, but is notlimited to, computer system 500, main memory 508, secondary memory 510,and removable storage units 518 and 522, as well as tangible articles ofmanufacture embodying any combination of the foregoing. Such controllogic, when executed by one or more data processing devices (such ascomputer system 500), causes such data processing devices to operate asdescribed herein.

Based on the teachings contained in this disclosure, it will be apparentto persons skilled in the relevant art(s) how to make and use theinvention using data processing devices, computer systems and/orcomputer architectures other than that shown in FIG. 5. In particular,embodiments may operate with software, hardware, and/or operating systemimplementations other than those described herein.

CONCLUSION

It is to be appreciated that the Detailed Description section, and notthe Summary and Abstract sections, is intended to be used to interpretthe claims. The Summary and Abstract sections may set forth one or morebut not all exemplary embodiments of the invention as contemplated bythe inventors, and thus, are not intended to limit the invention or theappended claims in any way.

While the invention has been described herein with reference toexemplary embodiments for exemplary fields and applications, it shouldbe understood that the invention is not limited thereto. Otherembodiments and modifications thereto are possible, and are within thescope and spirit of the invention. For example, and without limiting thegenerality of this paragraph, embodiments are not limited to thesoftware, hardware, firmware, and/or entities illustrated in the figuresand/or described herein. Further, embodiments (whether or not explicitlydescribed herein) have significant utility to fields and applicationsbeyond the examples described herein.

Embodiments have been described herein with the aid of functionalbuilding blocks illustrating the implementation of specified functionsand relationships thereof. The boundaries of these functional buildingblocks have been arbitrarily defined herein for the convenience of thedescription. Alternate boundaries can be defined as long as thespecified functions and relationships (or equivalents thereof) areappropriately performed. Also, alternative embodiments may performfunctional blocks, steps, operations, methods, etc. using orderingsdifferent than those described herein.

References herein to “one embodiment,” “an embodiment,” “an exampleembodiment,” or similar phrases, indicate that the embodiment describedmay include a particular feature, structure, or characteristic, butevery embodiment may not necessarily include the particular feature,structure, or characteristic. Moreover, such phrases are not necessarilyreferring to the same embodiment. Further, when a particular feature,structure, or characteristic is described in connection with anembodiment, it would be within the knowledge of persons skilled in therelevant art(s) to incorporate such feature, structure, orcharacteristic into other embodiments whether or not explicitlymentioned or described herein.

The breadth and scope of the invention should not be limited by any ofthe above-described exemplary embodiments, but should be defined only inaccordance with the following claims and their equivalents.

1-20. (canceled)
 21. A system, comprising: first and second memorydevices configured to store first and second portions of code ofapplication, respectively; and at least one processing elementconfigured to execute in place the first portion of the code ofapplication from the first memory device during a first period and loadthe second portion of the code of application from the second memorydevice during a second period, and wherein the first and second periodsoverlap at least partly.
 22. The system of claim 21, wherein the secondportion of the code of application is loaded from the second memorydevice to a third memory device.
 23. The system of claim 22, wherein thefirst and third memory devices include memory having low latency and thesecond memory device includes memory having high latency.
 24. The systemof claim 22, wherein the first and second memory devices includenon-volatile memory and the third memory device includes volatilememory.
 25. The system of claim 21, wherein the at least one processingelement is further configured to use a memory address map to locate thefirst portion of the code of application in the first memory and to loadthe second portion of the code of the application from the secondmemory.
 26. The system of claim 21, wherein the at least one processingelement is further configured to execute in place hardwareinitialization code from the first memory.
 27. The system of claim 22,wherein the at least one processing element is further configured toexecute the second portion of the code of application from the thirdmemory.
 28. The system of claim 25, wherein the memory address mapcomprises a first section including address mappings for the firstportion of the code of application and a second section includingaddress mappings for the second portion of the code of application. 29.The system of claim 27, wherein the at least one processing element isfurther configured to execute the second portion of the code ofapplication using at least one of demand paging or shadow mode.
 30. Thesystem of claim 22, wherein the first memory includes NOR flash memory,the second memory includes NAND flash memory, and the third memoryincludes RAM memory.
 31. A method of operating a system, comprising:storing a first portion of code of application in a first memory and asecond portion of the code of application in a second memory of thesystem; using a memory address map, by a processor of the system,locating the first portion of the code of application in the firstmemory and at least a portion of the second portion of the code ofapplication in the second memory; executing in place from the firstmemory the first portion of the code of application during a firstperiod; and loading the at least a portion of the second portion of thecode of application from the second memory to a third memory during asecond period, wherein the first and second periods overlap at leastpartly.
 32. The method of claim 31, further comprising: executing the atleast a portion of the second portion of the code of application fromthe third memory during a third period, wherein commencement of thefirst period precedes commencement of the third period.
 33. The methodof claim 31, wherein the at least a portion of the second portion of thecode of application is a currently required part of the second portion.34. The method of claim 31, wherein the at least a portion of the secondportion of the code of application is an entirety of the second portion.35. The method of claim 31, wherein executing in place of the firstportion of the code of application comprises executing applicationinitialization code prior to executing application execution code. 36.The method of claim 31, wherein using the memory address map comprisesaccessing a first section of the memory address map including addressmappings for the first portion of the code of the application andaccessing a second section of the memory address map including addressmapping for the at least a portion of the second portion of the code ofapplication.
 37. The method of claim 31, wherein the first memorycomprises a low-latency, non-volatile memory and the second memorycomprises a longer-latency, non-volatile memory.
 38. The method of claim31, wherein the first memory includes NOR flash memory, the secondmemory includes NAND flash memory, and the third memory includes RAMmemory.
 39. The method of claim 31, further comprising: commencing toexecute in place hardware initialization code from the first memoryprior to commencing to execute the first portion of the application. 40.The method of claim 36, wherein using the memory address map comprisesaccessing the first section of the memory address map including addressmappings for the first portion of the code of the application in thefirst memory and accessing the second section of the memory address mapincluding address mapping for the at least a portion of the secondportion of the code of application in the second memory.